<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/12/28
 * Time: 17:48
 */

namespace app\admin\controller;

use app\admin\model\ChatGroup as ChatGroupModel;
class ChatGroup extends Index
{

    public function index()
    {
        return view();
    }

    public function indexData()
    {
        $chatGroupModel = new ChatGroupModel();
        $data = $chatGroupModel->getDataList();
        return json($data);
    }

    public function admin()
    {
        $chatGroupModel = new ChatGroupModel();
        $data = $chatGroupModel->admin();
        return view()->assign(['data'=>$data[0],'id'=>$data[1]]);
    }

    public function adminAdd()
    {
        $chatGroupModel = new ChatGroupModel();
        $res = $chatGroupModel->adminAdd();
        return $res;
    }

    public function edit()
    {
        $chatGroupModel = new ChatGroupModel();
        $res = $chatGroupModel->edit();
        return $res;
    }

}